﻿using System;
using System.Web.Configuration;


namespace Blog.Framework.Utility
{
    public static class Configuration
    {
        public static T GetConfiguration<T>(string sectionName)
        {
            T config = (T)WebConfigurationManager.GetSection(sectionName);

            if (config == null)
            {
                throw new Exception(String.Format("Configuration section named \"{0}\" not found.", sectionName));
            }

            return config;
        }
    }
}
